package routers

import (
	"monitor/controllers"
	"github.com/astaxie/beego"
)

func init() {
    beego.Router("/", &controllers.MainController{})
    //stack,cpu,port etc host info getting
    beego.Router("/redfish/v1/rich/Switches/:hostid/stack/stackMemberInfos",&controllers.StackController{})
    beego.Router("/redfish/v1/rich/Switches/:hostid/stack/portInfos",&controllers.PortController{})
    beego.Router("/redfish/v1/rich/Switches/:hostid/stack/portInfos/:position",&controllers.PortController{})
    beego.Router("/redfish/v1/rich/Switches/:hostid/stack/interfaceInfos",&controllers.InterfaceController{})
    beego.Router("/redfish/v1/rich/Switches/:hostid/stack/interfaceInfos/:ifname",&controllers.InterfaceController{})
    beego.Router("/redfish/v1/rich/Switches/:hostid/stack/cpuInfos",&controllers.CPUController{})
    beego.Router("/redfish/v1/rich/Switches/:hostid/stack/cpuInfos/:position",&controllers.CPUController{})
    beego.Router("/redfish/v1/rich/Switches/:hostid/stack/memoryInfos",&controllers.MemoryController{})
    beego.Router("/redfish/v1/rich/Switches/:hostid/stack/memoryInfos/:position",&controllers.MemoryController{})
    beego.Router("/redfish/v1/rich/Switches/:hostid/stack/macInfos",&controllers.MacController{})
    beego.Router("/redfish/v1/rich/Switches/:hostid/stack/macInfos/:id",&controllers.MacController{})
    
    //stack,cpu,port etc info changing subscribing
    beego.Router("/subscribe/:hostid/stackMemberInfos",&controllers.StackSubscribeController{})
    beego.Router("/subscribe/:hostid/portInfos",&controllers.PortSubscribeController{})
    beego.Router("/subscribe/:hostid/portInfos/:position",&controllers.PortSubscribeController{})
    beego.Router("/subscribe/:hostid/stack/interfaceInfos",&controllers.InterfaceSubscribeController{})
    beego.Router("/subscribe/:hostid/stack/interfaceInfos/:ifname",&controllers.InterfaceSubscribeController{})
    beego.Router("/subscribe/:hostid/stack/cpuInfos",&controllers.CPUSubscribeController{})
    beego.Router("/subscribe/:hostid/stack/cpuInfos/:position",&controllers.CPUSubscribeController{})
    beego.Router("/subscribe/:hostid/stack/memoryInfos",&controllers.MemorySubscribeController{})
    beego.Router("/subscribe/:hostid/stack/memoryInfos/:position",&controllers.MemorySubscribeController{})
    beego.Router("/subscribe/:hostid/stack/macInfos",&controllers.MacSubscribeController{})
    beego.Router("/subscribe/:hostid/stack/macInfos/:id",&controllers.MacSubscribeController{})
    
    //组合查询
    //1.1.1查询指定逻辑交换机的信息
    beego.Router("/redfish/v1/rich/NetworkService/LogicalSwitches/:id",&controllers.LogicSwtichController{})
    //1.1.2查询指定逻辑交换机的port集合信息
    beego.Router("/redfish/v1/rich/NetworkService/LogicalSwitches/:id/PortInfo",&controllers.LogicPortController{})
    //1.1.3查询指定逻辑交换机的port集合uuid信息
    beego.Router("/redfish/v1/rich/NetworkService/LogicalSwitches/:id/PortInfo/:uuid",&controllers.PortUUIDController{})
    
    //1.1.4查询指定逻辑交换机的MAC表集合信息
    beego.Router("/redfish/v1/rich/NetworkService/LogicalSwitches/:id/MacTables",&controllers.LogicMacController{})
    //1.1.5 查询指定逻辑交换机指定MAC表的信息
    beego.Router("/redfish/v1/rich/NetworkService/LogicalSwitches/:id/MacTables/:uuid",&controllers.MacUUIDController{})
    
    //regsiter ,open,close device
    beego.Router("/registerhost",&controllers.RegisterController{}) //register host device
    beego.Router("/unregisterhost",&controllers.UnRegisterController{}) //unregister host device
    beego.Router("/operatehost",&controllers.OperateController{})   //open or close host device
    //beego.Router("/gethostinfo",&controllers.GethostinfoController{})// get hostinfo from from redis
    
  
}
